package com.jgp.glmeeting.controller;

import com.jgp.glmeeting.model.Participants;
import com.jgp.glmeeting.service.ParticipantsService;
import com.jgp.sys.common.controller.JGPController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/glMeeting/participantsController")
public class ParticipantsController extends JGPController {

    @Autowired
    private ParticipantsService participantsService;

    //跳转到listParticipants页面
    @RequestMapping("/listParticipants")
    public String listParticipants(){
        return page("listParticipants");
    }

    //跳转到添加人员页面addParticipant
    @RequestMapping("/addParticipant")
    public String addParticipant(){
        return page("addParticipant");
    }

    //跳转到showJoinMeeting的页面进行参加会议设置（参会人都参加哪些会议）
    @RequestMapping("/addJoinMeeting/{id}")
    public String addJoinMeeting(@PathVariable Long id, Model model){
        model.addAttribute("usersID",id);
        return page("addJoinMeeting");
    }
   //跳转到编辑人员页面edit  改是...先查询在改
    @RequestMapping("/editParticipants/{id}")
   public String editParticipants(@PathVariable String id, Model model){
       Participants p= participantsService.queryById(id);
       re(model,"editParticipants",p);
      return page("editParticipants");
   }
}
